<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title></title>
</head>
<body>

<script type="text/javascript">
	let str = '孙悟空摘西瓜'

	//replace(旧字符串，要替换的新字符串)字符串替换 返回新的字符串
	console.log(str.replace('西瓜','桃子'))

	// split() 分割字符串 返回数组
	let str2 = '"http://www.baidu.com?user=孙悟空&sex=男'
	let newStr = str2.split('?')[1].split('&')
	console.log(newStr)
	newStr.forEach(function(item,index) {
		console.log(item.split('=')[1])
	})

	//toLowerCase() 转小写
	// toUpperCase() 转大写
	let str3 = "Good good study, day day up"
	console.log(str3.toLowerCase()) //good good study, day day up
	console.log(str3.toUpperCase())//GOOD GOOD STUDY, DAY DAY UP

</script>
</body>
</html>